#pragma once
#include <unistd.h>
#include <fcntl.h>
#include "TcpServer.hpp"

void SetNonBlockOrDie(int sockfd)
{
    int fl = fcntl(sockfd, F_GETFL);
    if (fl < 0)
        exit(NON_BLOCK_ERR);
    fcntl(sockfd, F_SETFL, fl | O_NONBLOCK);
}
